#include <iostream>
#include "spot.h"
using namespace std;

int main()
{
    Distance spots[total]={云谷寺,白鹅岭,65,180,0,云谷寺,白鹅新站,0,0,50};
    Way ways[total+1]={};
    spot found_old[total]={};
    spot found_new[total]={云谷寺};
    spot unfound[total]={};
    int init=0;
    while (init<=total-1){
        unfound[init]=(spot)(init+1);
        init++;
    };
    drop(云谷寺, unfound);


    //cout<<(int)unfound[1]<<endl;没有声明的结构体内部都是0

    bool found=false;
    int distance_between_them;
    while (!found) {
        for(spot unfounds : unfound){//注意这里会对空内容也循环
            for(spot found_news : found_new){
                distance_between_them=cost_simple(unfounds,found_news,spots);
                if(!distance_between_them){
                    cout<<distance_between_them<<endl;
                    if(distance_between_them>=ways[unfounds].cost){
                        ways[unfounds].cost=distance_between_them;
                        ways[unfounds].steps++;
                        insert(found_news, ways[unfounds].path);
                    }
                }
                drop(found_news, found_new);
                insert(found_news, found_old);
            }

        }
        for(spot found_news : found_new){
            if(found_news==白鹅新站){
                found=true;
                cout<<"找到答案，循环结束，开始展示结果";
            }

        }
    }
    //ways[云谷寺].cost=10;
    return 0;
};



